<template>
	<main class="inner-page">
		<van-list v-if="shopList&&shopList.length>0"
				  :finished="pager.finished" v-model:loading="pager.loading" v-model:error="pager.error" error-text="请求失败，点击重新加载">
			<template #finished><van-divider>没有更多了</van-divider></template>
			<hot-rank-item v-for="item in shopList" :shop="item" key="item.shopId"/>
		</van-list>
		<van-empty v-else image="search" description="很抱歉，暂无结果~" />
	</main>
</template>
<style lang="scss" scoped>
.inner-page{
	padding-bottom:calc(50px + env(safe-area-inset-bottom));
}
</style>
<script lang="ts" setup>
defineOptions({name:'searchShop'})
import {SearchShopsCondition} from '@/types'

//props
const props =defineProps({
})
//data
const {searchKey,shopCondition,pager,} = useSearch()//从hooks中解构查询页所需的响应式变量

const locateOptions=[// todo: 通过用户类型、用户信息读取可选的地址信息
	{ text: '北京 - 东城区', value: 'Hangzhou' },
	{ text: '浙江 - 杭州', value: 'Ningbo' },
	{ text: '新疆 - 乌鲁木齐', value: 'Wenzhou' },
	{ text: '广西 - 南宁', value: '59-591' },
	{ text: '黑龙江 - 齐齐哈尔', value: 'Huzhou' },
]

//todo: 查询结果列表 demo
const shopList = ref(<Array<any>>[])
shopList.value = [
	{
		shopId: 'ZBCU4321',  //string '店铺id',
		shopShortName: '大沃尔科技全国连锁旗舰店',  //string '店铺简称',
		logoPath: 'https://cbu01.alicdn.com/img/ibank/O1CN017oL5fb1Bs2q98efJU_!!0-0-cib.jpg',  //string '店铺logo',
		shopType: '',  //string 店铺类型,
		shopCat: '手机 | 智能终端 | 行业模组 | 3C配件 | 权益 | 电商百货', //string 主营范围，为商品分类若干一级节点编号，逗号隔开的字串
		offlineSupported: '1', //string 是否支持线下支付0否 1支持
		cloubSupplier: '1', //string 是否优品小店供货商 0否 1是
		allowBackDay: 7,  //number允许退货天数
		createTime: '2018-01-21', //string 开店时间
		cautionMoney:20, //入店保障金，万元
		offers: [
			{
				gdsId: '商品id',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01cMmiAS1gRFf71suul_!!2211261674138-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01nY2rAg1gRFhjZb7JE_!!2211261674138-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01dijmTp27YZbRRRIXV_!!2211851637809-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01gSau2e1Mr5h96OI0r_!!2361561487-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01zFXpY01FbnCiGKtVM_!!2207691150506-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
		],
	},
	{
		shopId: 'ZBCU4643',  //string '店铺id',
		shopShortName: '大沃尔科技全国连锁旗舰店',  //string '店铺简称',
		logoPath: 'https://cbu01.alicdn.com/img/ibank/O1CN017oL5fb1Bs2q98efJU_!!0-0-cib.jpg',  //string '店铺logo',
		shopType: '',  //string 店铺类型,
		shopCat: '手机 | 智能终端 | 行业模组 | 3C配件 | 权益 | 电商百货', //string 主营范围，为商品分类若干一级节点编号，逗号隔开的字串
		offlineSupported: '1', //string 是否支持线下支付0否 1支持
		cloubSupplier: '1', //string 是否优品小店供货商 0否 1是
		allowBackDay: 7,  //number允许退货天数
		createTime: '2018-01-21', //string 开店时间
		cautionMoney:20, //入店保障金，万元
		offers: [
			{
				gdsId: '商品id1',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01cMmiAS1gRFf71suul_!!2211261674138-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id2',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01nY2rAg1gRFhjZb7JE_!!2211261674138-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id3',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01dijmTp27YZbRRRIXV_!!2211851637809-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id4',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01gSau2e1Mr5h96OI0r_!!2361561487-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id5',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01zFXpY01FbnCiGKtVM_!!2207691150506-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id6',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01cMmiAS1gRFf71suul_!!2211261674138-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id7',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01nY2rAg1gRFhjZb7JE_!!2211261674138-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id8',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01dijmTp27YZbRRRIXV_!!2211851637809-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id9',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01gSau2e1Mr5h96OI0r_!!2361561487-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
			{
				gdsId: '商品id10',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01zFXpY01FbnCiGKtVM_!!2207691150506-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
		],
	},
	{
		shopId: 'ZBCU01',  //string '店铺id',
		shopShortName: '大沃尔科技全国连锁旗舰店',  //string '店铺简称',
		logoPath: 'https://cbu01.alicdn.com/img/ibank/O1CN017oL5fb1Bs2q98efJU_!!0-0-cib.jpg',  //string '店铺logo',
		shopType: '',  //string 店铺类型,
		shopCat: '手机 | 智能终端 | 行业模组 | 3C配件 | 权益 | 电商百货', //string 主营范围，为商品分类若干一级节点编号，逗号隔开的字串
		offlineSupported: '1', //string 是否支持线下支付0否 1支持
		cloubSupplier: '1', //string 是否优品小店供货商 0否 1是
		allowBackDay: 7,  //number允许退货天数
		createTime: '2018-01-21', //string 开店时间
		cautionMoney:20, //入店保障金，万元
		offers: [
			{
				gdsId: '商品id1',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01cMmiAS1gRFf71suul_!!2211261674138-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
		],
	},
	{
		shopId: 'ZBCU02',  //string '店铺id',
		shopShortName: '大沃尔科技全国连锁旗舰店',  //string '店铺简称',
		logoPath: 'https://cbu01.alicdn.com/img/ibank/O1CN017oL5fb1Bs2q98efJU_!!0-0-cib.jpg',  //string '店铺logo',
		shopType: '',  //string 店铺类型,
		shopCat: '手机 | 智能终端 | 行业模组 | 3C配件 | 权益 | 电商百货', //string 主营范围，为商品分类若干一级节点编号，逗号隔开的字串
		offlineSupported: '1', //string 是否支持线下支付0否 1支持
		cloubSupplier: '1', //string 是否优品小店供货商 0否 1是
		allowBackDay: 7,  //number允许退货天数
		createTime: '2018-01-21', //string 开店时间
		cautionMoney:20, //入店保障金，万元
		offers: [
			{
				gdsId: '商品id1',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01cMmiAS1gRFf71suul_!!2211261674138-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
		],
	},
	{
		shopId: 'ZBCU03',  //string '店铺id',
		shopShortName: '大沃尔科技全国连锁旗舰店',  //string '店铺简称',
		logoPath: 'https://cbu01.alicdn.com/img/ibank/O1CN017oL5fb1Bs2q98efJU_!!0-0-cib.jpg',  //string '店铺logo',
		shopType: '',  //string 店铺类型,
		shopCat: '手机 | 智能终端 | 行业模组 | 3C配件 | 权益 | 电商百货', //string 主营范围，为商品分类若干一级节点编号，逗号隔开的字串
		offlineSupported: '1', //string 是否支持线下支付0否 1支持
		cloubSupplier: '1', //string 是否优品小店供货商 0否 1是
		allowBackDay: 7,  //number允许退货天数
		createTime: '2018-01-21', //string 开店时间
		cautionMoney:20, //入店保障金，万元
		offers: [
			{
				gdsId: '商品id1',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01cMmiAS1gRFf71suul_!!2211261674138-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
		],
	},
	{
		shopId: 'ZBCU04',  //string '店铺id',
		shopShortName: '大沃尔科技全国连锁旗舰店',  //string '店铺简称',
		logoPath: 'https://cbu01.alicdn.com/img/ibank/O1CN017oL5fb1Bs2q98efJU_!!0-0-cib.jpg',  //string '店铺logo',
		shopType: '',  //string 店铺类型,
		shopCat: '手机 | 智能终端 | 行业模组 | 3C配件 | 权益 | 电商百货', //string 主营范围，为商品分类若干一级节点编号，逗号隔开的字串
		offlineSupported: '1', //string 是否支持线下支付0否 1支持
		cloubSupplier: '1', //string 是否优品小店供货商 0否 1是
		allowBackDay: 7,  //number允许退货天数
		createTime: '2018-01-21', //string 开店时间
		cautionMoney:20, //入店保障金，万元
		offers: [
			{
				gdsId: '商品id1',
				gdsImg: 'https://cbu01.alicdn.com/img/ibank/O1CN01cMmiAS1gRFf71suul_!!2211261674138-0-cib.220x220.jpg',
				gdsName: '商品名称商品名称商品名称商品名称',
				agentPrice: 320000, //number提货价，分(游客访问时该字段留空),
				guidePrice: 380000, //number指导价，分,
				saleAmount: 32, //number季销量
			},
		],
	},
]
const router=useRouter()

//methods
const locateChange=(value:string)=>{
	console.log(value)
	//todo: 自动触发从新查询
}

</script>